package com.csgc.camera.widget.dialog.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.cysd.spsyxj.databinding.PickerItemBinding


class PickerAdapter constructor(val context: Context, val list:ArrayList<Int> = ArrayList(),val type:String) : RecyclerView.Adapter<PickerAdapter.PickerViewHolder>() {


        override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PickerViewHolder {
            return PickerViewHolder(PickerItemBinding.inflate(LayoutInflater.from(context),parent,false))
        }

        override fun onBindViewHolder(holder: PickerViewHolder, position: Int) {
            holder.binding.tvPickerName.text = "${list[position]}$type"
        }

        override fun getItemCount(): Int {
            return list.size
        }


    class PickerViewHolder(val binding: PickerItemBinding):RecyclerView.ViewHolder(binding.root)


    }